<footer id="footer">
	<div class="footer-top ofl">
    	<div class="footer-inner">
        	<div class="footer-menu fll">
            	<div class="col w135 fll">
                	<h4><?php echo $text_footer_company;?></h4>
                    <ul>
                    	<li><a href="<?php echo $this->url->link('common/about');?>"><?php echo $text_footer_about_us;?></a></li>
                        <li><a href="<?php echo $this->url->link('information/contact');?>"><?php echo $text_footer_contact_us;?></a></li>
                        <li><a href="<?php echo $this->url->link('common/sitemap');?>"><?php echo $text_footer_sitemap;?></a></li>
                    </ul>
                </div>
                <div class="col fll" style="width:140px;">
                	<h4><?php echo $text_footer_more_info;?></h4>
                    <ul>
                    	<li><a href="<?php echo $this->url->link('common/faq');?>"><?php echo $text_footer_faq;?></a></li>
                        <li><a href="<?php echo $this->url->link('common/warranty');?>"><?php echo $text_footer_warranty;?></a></li>
                        <li><a href="<?php echo $this->url->link('common/term_of_use');?>"><?php echo $text_footer_term;?></a></li>
                    </ul>
                </div>
            </div>
            <div class="newsletter flr">
            	<div class="newsletter-form w290 flr">
                 <script type="text/javascript">
		$(function () {
			 $.validator.addMethod("default_newsletter", function(value, element) 
				{
					//alert(element.value);
				 switch (element.value) 
				 {
					
					 case "<?php echo $text_newsletter_default;?>": 	if (element.name == "fnewsletter") return false;
					 default:
					 return true;
					 break;
					 
			
				 }
				  return true;
				});
				
				$("#newsletterForm").validate(
					{
						errorPlacement: function(error, element) {			
					},
					invalidHandler: function(form, validator) {
					  var errors = validator.numberOfInvalids();
					if (errors) {
						$('#alert').html(validator['errorList'][0]['message']);
						$('#backoverlay').show();
						$('#show_popup').show();
						$('#f_focus').html(validator['errorList'][0]['element'].name);
						validator['errorList'][0]['element'].focus();
					  } else {
					  }
					},
					rules: {
						fnewsletter : {
							default_newsletter : true,
							required: true,
							email: true
						}
						
					},
					messages: {
						fnewsletter: "<?php echo $text_newsletter_requirement;?>",
					},
					submitHandler: function(form) {
						$.ajax({
								url: 'index.php?route=account/newsletter/joinnewsletter',
								type: 'post',
								data: $('#fnewsletter ,#newsleter_join'),
								dataType: 'json',
								success: function(json) {
									
									if (json['error']) {
										$('#alert').html(json['error']);
										$('#backoverlay').show();
										$('#show_popup').show();
									}	 
									if (json['success']) {
										$('#alert').html(json['success']);
										$('#backoverlay').show();
										$('#show_popup').show(json['success']);
										$('#fnewsletter').val("");
									}	
								}
							});
					}
				});
				close_popup=function(){		
									var fel=$('#f_focus').html();
									$('#backoverlay').hide();
									$('#show_popup').hide();
									$('#' + fel ).focus();		
							  };
		});
		</script>
                	<form id="newsletterForm" method="post">
                    	<fieldset>
                        	<input class="input-txt" type="text" title="<?php echo $text_newsletter_default;?>" id="fnewsletter" name="fnewsletter"  />
                            <input class="input-txt" type="hidden" id="newsleter_join" name="newsleter_join" value="1" />
                            <p><a id="btn_join_newsletter" onclick="$('#newsleter_join').val(1);$('#newsletterForm').submit();" class="submit fll" ><?php echo $text_footer_subscribe;?></a> <a class="submit fll"  onclick="$('#newsleter_join').val(0);$('#newsletterForm').submit();"><?php echo $text_footer_unsubscribe;?></a></p>
                        </fieldset>
                    </form>
                    
                </div>
            	<div class="newsletter-desc w290 flr">
                	<h4><?php echo $newsletter_title;?></h4>
                    <?php echo $newsletter_desc;?>
                </div>
            </div>
        </div>
    </div>
    <div class="copyright ofl">
        <div class="footer-inner">
            <p><?php echo $title;?></p>
        </div>
    </div>
</footer><!--footer-->
		<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="catalog/view/theme/default/js/vendor/jquery-1.8.0.min.js"><\/script>')</script>
        -->
        
        
        <script src="catalog/view/theme/default/js/jquery-ui.js"></script>
        <script src="catalog/view/theme/default/js/colorbox.js"></script>
        <script src="catalog/view/theme/default/js/selectbox.js"></script>
        <script src="catalog/view/theme/default/js/jquery-ui.js"></script>
        <script src="catalog/view/theme/default/js/magiczoom-custom.js"></script>
        <script>
		MagicZoomPlus.options = {
		  'zoom-width':'0',
		  'zoom-height':'0',
		
			'expand-effect':'linear',
			'background-opacity':'0',
			'expand-speed':'200',
			'expand-speed':'200',
			'disable-expand':false,
			'disable-zoom':false,
			'thumb-change':'click',
			'buttons-display':'close'
		}

        </script>
        <script src="catalog/view/theme/default/js/plugins.js"></script>
        <script src="catalog/view/theme/default/js/main.js"></script>
        
        

        <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
        <script>
            var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
            (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
            g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
            s.parentNode.insertBefore(g,s)}(document,'script'));
        </script>
       
        <style>	
    .bg_alert{ width:275px; height:115px; background:url("catalog/view/theme/default/images/bg_alert.png") no-repeat top left; margin:0px auto; padding:10px 0px 0px 78px; color:#000;}
    .m35l{ margin-left:35px;}
        </style>
		<div id="dialog" style="display:none; position: fixed; top: 10%; left: 35%; z-index:10002;"></div>
		<div class="bg_alert" id="show_popup" style="font-size:13px; display:none; position: fixed; top: 35%; left: 50%; z-index:10003; margin-left:-140px;">
			<span id="f_focus" style="display:none;"></span>
			<div style="margin:0; padding-top:0px; min-height:75px;width:260px;" id="alert"></div>
			<div style="padding-left: 40px;"><a href="javascript:void(0);" onclick="close_popup();"><img src="catalog/view/theme/default/images/bt_close.png" alt="" /></a></div>
		</div>
		<div style="display: none;position: fixed; top: 0;left: 0;width: 100%;height: 100%;background-color: #000000;z-index:10002;-moz-opacity: 0.8;opacity:.80;filter: alpha(opacity=80);" id="backoverlay">
		</div>	

    </body>
</html>
<?php return;?>

<!--Footer-->
<div id="footer">
    <div class="footer-ctn">
        <div class="footer-inner">
            <!-- Footer social-->
            <div class="social col-04 fl-left spliter mr20">
            	<h3>Kết nối với chúng tôi</h3>
                <div class="fb">
                	
                    <img class="fl-left" src="catalog/view/theme/default/img/mb-fb.png" alt="" />
                    <div class="mb-fb fl-left">
                    	<p><strong>Trên Facebook</strong> </p>
                    	<div class="fb-like" data-href="http://www.shopmebuu.com.vn" data-send="false" data-layout="button_count" data-width="115" data-show-faces="false" data-font="lucida grande"></div>
                    </div>
                </div>
                <div class="newsletter fl-left mt5">
                    <p><em>Đăng ký nhận thư tin tức sản<br/> phẩm mới, khuyến mãi, dịch vụ...</em></p>
                    <form id="newsletterForm" method="post">
                        <fieldset>
                            <input id="fnewsletter" name="fnewsletter" type="text" class="input-txt" value="Nhập email của bạn" />
                            <a id="btn_join_newsletter" onclick="$('#newsletterForm').submit();" class="btn submit-btn fl-left" title="Gửi Đăng ký"><img src="catalog/view/theme/default/img/ok_btn.png" alt="OK" /></a>
                        </fieldset>
                    </form>
                </div>
            </div>
            <!--/Footer social-->
            <!-- Footer menu-->
            <div class="col-04 fl-left spliter mr20">
                <h3>Hỗ trợ khách hàng</h3>
                <ul>
                    <li><a class="parent" href="<?php echo $this->url->link('information/contact');?>">Liên hệ</a></li>
                    <li><a class="parent" href="<?php echo $this->url->link('common/faq');?>">Câu hỏi thường gặp</a></li>
                    <li><a class="parent" href="<?php echo $this->url->link('common/term_of_use');?>">Điều Khoản & Điều Kiện</a></li>
                    <li><a class="parent" href="<?php echo $this->url->link('common/privacy_policy');?>">Chính Sách Bảo Mật</a></li>
                </ul> 
             </div>
             <div class="col-04 fl-left spliter">
                <h3>Hình thức thanh toán</h3>
                <div class="cards pb10"><img src="catalog/view/theme/default/img/credit-cards.png" alt="" /></div>
                <h3>Dịch vụ vận chuyển</h3>
                <div class="cards"><a class="tip" href="http://www.ttcvina.com" target="_blank" title="Vận chuyển phát nhanh Tín Thành"><img src="catalog/view/theme/default/img/tinthanh-logo.png" alt="" /></a></div>

             </div>
            <!--/ Footer menu-->
            <div class="col-03 copyright fl-left">
                <?php echo $description;?>
                <p><em>Thiết kế và thực hiện bởi</em><br/><a >tpdesign</a></p>
                
            </div>
        
        </div>    
    </div>
    <div id="toTop"><a class="shadow" href="#top">Lên đầu trang</a></div>
</div>
<!--/Footer--> 
<script type="text/javascript">
	$(function () {
		var scroll_timer;
		var displayed = false;
		var $message = $('#toTop a');
		var $window = $(window);
		var top = $(document.body).children(0).position().top;
		$window.scroll(function () {
			window.clearTimeout(scroll_timer);
			scroll_timer = window.setTimeout(function () {
				if($window.scrollTop() <= top)
				{
					displayed = false;
					$message.fadeOut(500);
				}
				else if(displayed == false)
				{
					displayed = true;
					$message.stop(true, true).show().click(function () { $message.fadeOut(500); });
				}
			}, 100);
		});
	});
</script>
<script type="text/javascript">

jQuery(function($){
	 jQuery.validator.addMethod("default_newsletter", function(value, element) 
	{
		//alert(element.value);
	 switch (element.value) 
	 {
		
		 case "Nhập email của bạn": 	if (element.name == "fnewsletter") return false;
		 default:
		 return true;
		 break;
		 

	 }
	  return true;
	});
	
	$("#newsletterForm").validate(
		{
			errorPlacement: function(error, element) {			
		},
		invalidHandler: function(form, validator) {
		  var errors = validator.numberOfInvalids();
		if (errors) {
			$('#alert').html(validator['errorList'][0]['message']);
			$('#backoverlay').show();
			$('#show_popup').show();
			$('#f_focus').html(validator['errorList'][0]['element'].name);
			validator['errorList'][0]['element'].focus();
		  } else {
		  }
		},
		rules: {
			fnewsletter : {
				default_newsletter : true,
				required: true,
				email: true
			}
			
		},
		messages: {
			fnewsletter: "Nhập email của bạn",
		},
		submitHandler: function(form) {
			$.ajax({
					url: 'index.php?route=account/newsletter/joinnewsletter',
					type: 'post',
					data: $('#fnewsletter'),
					dataType: 'json',
					success: function(json) {
						
						if (json['error']) {
							$('#alert').html(json['error']);
							$('#backoverlay').show();
							$('#show_popup').show();
						}	 
						if (json['success']) {
							$('#alert').html(json['success']);
							$('#backoverlay').show();
							$('#show_popup').show(json['success']);
							$('#fnewsletter').val("");
						}	
					}
				});
		}
	});

			/*Ads handle*/
			$("#ads a").click(function(e){
				$this = $(this);
				$parent = $this.closest("#ads");
					if($parent.hasClass("active")){
						$parent.removeClass("active");
						$parent.find('.open').hide("slow");
						$parent.find('.close').show("slow");
						$parent.find(".ads-section-l").show("slow");

					}else{
						$parent.addClass("active");
						$parent.find('.close').hide("slow");
						$parent.find('.open').show("slow");
						$parent.find(".ads-section-l").show();
					}
					
				e.preventDefault;
			}); 
			
			
		});
</script>
<?php
    if(!isset($this->request->get['route'])) {
    	$route = 'common/home';
    } else {
   		$route = $this->request->get['route'];
    }
	if($route=='common/home' && $birthdays) {
?>

<div id="ads" class="active" >
    <div class="ads-header-l">
        <div class="ads-header-r">
                <h3 class="text-shadow">QUẢNG CÁO - SỰ KIỆN</h3>
                <a class="text-shadow close" href="#">Mở</a>
                <a class="text-shadow open" href="#">Đóng</a>
        </div>
    </div>
    <div  class="ads-section-l">
        <div class="ads-section-r">
        	<div id="ads-events">
            	<?php foreach ($birthdays as $row) { ?>
                <a href="#"><img src="<?php echo $row['image'];?>" width="340" alt="<?php echo $row['namechild'];?>" rel="<h3><?php echo $row['namechild'];?></h3><?php echo $this->commonfunc->trunchtml($row['description'],50,'');?>" /></a>
                <?php  } ?>
                
                <div class="caption">
                	<div class="content"></div>
                </div>
            </div>
        </div>
    </div>	
    
</div>
<script type="text/javascript">
	$(document).ready(function() {
		slideShow();
	});
	
	function slideShow() {
	
		$('#ads-events a').css({opacity: 0.0});
		
		$('#ads-events a:first').css({opacity: 1.0});
		
		$('#ads-events .caption').css({opacity: 0.7});
	
		$('#ads-events .caption').css({width: $('#ads-events a').find('img').css('width')});
		
		$('#ads-events .content').html($('#ads-events a:first').find('img').attr('rel'))
		.animate({opacity: 0.7}, 400);

		setInterval('gallery()',6000);
		
	}
	
	function gallery() {
		
		var current = ($('#ads-events a.show')?  $('#ads-events a.show') : $('#ads-events a:first'));
	
		var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#ads-events a:first') :current.next()) : $('#ads-events a:first'));	
		
		var caption = next.find('img').attr('rel');	
		
		next.css({opacity: 0.0})
		.addClass('show')
		.animate({opacity: 1.0}, 1000);
	
		current.animate({opacity: 0.0}, 1000)
		.removeClass('show');
		
		//Set the opacity to 0 and height to 1px
		$('#ads-events .caption').animate({opacity: 0.0}, { queue:false, duration:50 }).animate({height: '0px'}, { queue:true, duration:300 });	
		
		$('#ads-events .caption').animate({opacity: 0.8},100 ).animate({height: '50px'},500 );
		
		$('#ads-events .content').html(caption);
			
		
	}

</script>

<?php
	}
?>

<style>	
    .bg_alert{ width:275px; height:115px; background:url("catalog/view/theme/default/images/bg_alert.png") no-repeat top left; margin:0px auto; padding:10px 0px 0px 78px; color:#000;}
    .m35l{ margin-left:35px;}
</style>
<div id="dialog" style="display:none; position: fixed; top: 10%; left: 35%; z-index:10002;"></div>
<div class="bg_alert" id="show_popup" style="font-size:13px; display:none; position: fixed; top: 35%; left: 50%; z-index:10003; margin-left:-140px;">
    <span id="f_focus" style="display:none;"></span>
    <div style="margin:0; padding-top:0px; min-height:75px;width:260px;" id="alert"></div>
    <div style="padding-left: 40px;"><a href="javascript:void(0);" onclick="close_popup();"><img src="catalog/view/theme/default/images/bt_luk.png" alt="" /></a></div>
</div>
<div style="display: none;position: fixed; top: 0;left: 0;width: 100%;height: 100%;background-color: #000000;z-index:10002;-moz-opacity: 0.8;opacity:.80;filter: alpha(opacity=80);" id="backoverlay">
</div>	
<script type="text/javascript">
close_popup=function(){		
	var fel=$('#f_focus').html();
	$('#backoverlay').hide();
	$('#show_popup').hide();
};
</script>